{extend name="Public:base"/}

{block name="main"}
<div class="box-info">
    <div class="table-toolbar">
        <a title="新增" class="btn btn-primary" href="{:U('Menu/add')}">新增</a>&nbsp;
    </div>

    <div class="row">
        <div class="col-md-12">
            <form id="myform" action="{:U('menu/listorder')}" method="post">
                <table class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th>排序</th>
                        <th>ID</th>
                        <th>菜单名称</th>
                        <th>图标</th>
                        <th>菜单链接</th>
                        <th>状态</th>
                        <th class="w-200">管理操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="menu_list" id="vo"}
                    <tr>
                        <td>{$vo.listorder}</td>
                        <td>{$vo.id}</td>
                        <td>{$vo.title_prefix}<a href="{:U('Menu/index','pid='.$vo['id'])}">{$vo.name}</a></td>
                        <td>
                            {notempty name="vo.icon"}<i class="{$vo.icon}"></i>{/notempty}
                        </td>
                        <td>{$vo.node}</td>
                        <td>
                            {eq name="vo.status" value="1"}
                            <a href="{:U('Menu/status',array(id=>$vo['id'],status=>0))}"><i class="fa fa-check text-success"></i></a>
                            {else/}
                            <a href="{:U('Menu/status',array(id=>$vo['id'],status=>1))}"><i class="fa fa-ban text-danger"></i></a>
                            {/eq}
                        </td>
                        <td>
                            <a class="btn btn-sm btn-primary"
                               href="{:U('menu/add',array( 'parentid' => $vo['id']))}">添加子菜单</a>
                            <a class="btn btn-sm btn-info" href="{:U('menu/edit',array('id' => $vo['id']))}">修改</a>
                            <a class="btn btn-sm btn-danger"
                               href="javascript:confirm_delete('{:U('Menu/delete',array('id' => $vo['id']))}')">删除</a>
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </form>
        </div>

    </div>

</div>
{/block}